/*****************************************************************************
* file  : systask.c
* creat : apleilx
* data  : 2017/11/05
*******************************************************************************/
#define _GUI_MAIN_MODULE_
#include "os_obj.h"
#include "pincfg.h"
#include "dataproc.h"
#include "gui_main.h"
#include "string.h"
#include "lcd_yl.h"
#include "bsp_api.h"
#include "str_ext.h"

void img_check(void);
void spim_sw_spi_init(void);

int oled_init(void);
void gui_dbg(void);
	

/*****************************************************************************
*
* @brief   storage task.
*
* @param   none
*
* @return  none
*
* @ Pass/ Fail criteria: none
*****************************************************************************/
void gui_task(void const *argument)
{
	uint16_t row_start, row_size;

	osDelay(ms_ticks(20));

	lcd_yl_init();

	pulse_init(&gui_st.pulse, app_tick_get());

	lcd_yl_origin_set(0, 16);

	gui_st.move_site_x = 0;
	lcd_yl_font_set(32, 32, Font_16_32);
	
	lcd_yl_ram_fill(0xff);
	lcd_yl_anti();
	
	while(1)
	{
		lcd_yl_origin_set(32, 16);
		pulse_create(&gui_st.pulse, app_tick_get());
		osDelay(2);
		
		
		lcd_yl_poll(32, 2, 8);
		lcd_yl_space_set(4);
		lcd_yl_half_en();
		
		
		lcd_yl_font_set(24, 24, Font_12_24);
		lcd_yl_alain_puts(64,32,"OLED", TEXT_X_MID | TEXT_Y_MID | TEXT_SQ(2,7,0) | TEXT_LINE(2,0));
		lcd_yl_origin_set(32+128, 16);

	}

	gui_st.gui_cnt++;

}

void gui_notice(const char *str)
{
	gui_st.notice_mode = 1;
	copy_str(str, gui_st.notice_str, 128);
}
